package com.book.workbench.mapper;

import com.book.workbench.pojo.Book;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface BookMapper {

    //根据书籍number查找书籍
    public Book getBookByNumber(String number);

    //添加书籍
    public Integer addBook(Book book);

    //删除书籍根据ID
    public Integer deleteBookById(Book book);

    //模糊查询book
    public List<Book> getListBook(Book book);
    public Integer getCountListBook(Book book);

    //修改book
    public Integer updateBookById(Book book);

    //修改书籍是否在库
    public Integer updateBookExist(@Param("book_id") String book_id, @Param("exist") String exist);

    //查看书籍是否在库
    public Integer searchBookIsExist(String book_id);

    //动态模糊查询还在库的书籍
    public List<Book> getListBookBy(Book book);
    public Integer getCountListBookBy(Book book);

    //查看用户还未归还的书籍
    public List<Book> searchUserNotReturnBook(String user_id);

    //查看所欲书籍
    public List<Book> getListAllBook(Book book);
    public Integer getCountListAllBook(Book book);

    //根据id查询书籍
    public Book searchBookById(String id);

    //根据kind_id查询书的数量
    public Integer getBookCountByKind_id(String kind_id);

}
